package com.liuzhilong.infrastructure.basic.factory.method;


import com.liuzhilong.infrastructure.basic.factory.method.define.Product1Factory;

/**
 * 客户端
 */
public class UseCase {

    /**
     * 工厂方法<br/>
     * 用{@link ProductFactory}接口做隔离，实现开闭原则。加上依赖注入，可以很好的进行逻辑的扩展和替换
     */
    public  static void  useCaseMethodFactory() throws ClassNotFoundException {
            //
            ProductFactory factory = new Product1Factory();
//            ProductFactory factory = new Product2Factory();
            Product product = factory.processProduct();
            product.doSome();


    }

}
